package com.stox.services.data.provider.manager.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.stox.services.data.provider.manager.ScripManager;
import com.stox.services.data.provider.repository.ScripRepository;
import com.stox.shared.model.Scrip;
import com.stox.shared.model.filter.ScripCriteria;

@Component
public class ScripManagerImpl implements ScripManager {

	@Autowired
	private ScripRepository scripRepository;
	
	public List<Scrip> findByScripCriteria(ScripCriteria scripFilter){
		return scripRepository.findByScripCriteria(scripFilter);
	}
	
	@Override
	public Scrip findOne(Long id) {
		return scripRepository.findOne(id);
	}

	@Override
	public List<Scrip> findByExchangeId(Long id) {
		return scripRepository.findAll();
	}
	
	@Override
	public void clearSaveAndFlush(List<Scrip> scrips) {
		scripRepository.clearSaveAndFlush(scrips);
	}

}
